﻿<UserControl x:Class="SensorDroneStudio.Views.DroneView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:viewModels="clr-namespace:SensorDroneStudio.ViewModels"
             xmlns:views="clr-namespace:SensorDroneStudio.Views"
             xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
             mc:Ignorable="d" 
             d:DataContext="{d:DesignInstance viewModels:DroneViewModel,IsDesignTimeCreatable=True }"
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid  DataContext="{Binding Source={StaticResource Locator}, Path=DroneViewModel}">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto">
            </RowDefinition>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        
        <Grid  Grid.Row="0" HorizontalAlignment="Stretch" >
            <Grid.RowDefinitions>
                <RowDefinition></RowDefinition>
                <RowDefinition></RowDefinition>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition></ColumnDefinition>
                <ColumnDefinition></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <TextBlock HorizontalAlignment="Stretch" MinWidth="100" FontWeight="Bold" FontSize="30" Text="{Binding Path=Name}"></TextBlock>
            <TextBlock Grid.Column="0" Grid.Row="1" MinWidth="100" FontSize="30" Text="{Binding Path=Version}"></TextBlock>
            <controls:ToggleSwitch IsChecked="{Binding Path=LedsOn}" Header="LED" Grid.Row="0" Grid.Column="1" Grid.RowSpan="2"></controls:ToggleSwitch>
        </Grid>
        <ScrollViewer VerticalAlignment="Stretch" Grid.Row="1" >
        <ListBox VerticalAlignment="Stretch"  HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch" ItemsSource="{Binding Path=Sensors}" >
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <views:SesnorView></views:SesnorView>
                </DataTemplate>
            </ListBox.ItemTemplate>
            
        </ListBox>
        </ScrollViewer>
    </Grid>
</UserControl>
